package com.team.project.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 逗逗
 * 2022/11/22 16:46
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {

    private int code;
    private String msg;
    private Object data;

    /**
     * 成功
     * @param data 需要返回的数据*/
    public static R ok(Object data){
        return new R(0,"OK",data);
    }
    /**
     * 成功*/
    public static R ok(){
        return ok(null);
    }
    /**
     * 失败*/
    public static R fail(Object data){
        return new R(100000,"FAIL",data);
    }

    public static R fail(){
        return fail(null);
    }
}
